package cn.foolishbird.crow.step;

/**
 * @author foolish bird
 * @email luohongtu@foolishbird.cn
 */
public abstract class PageReadOnlyIterator<E> implements ReadOnlyIterator<E> {

    /**
     * 前进步数
     */
    protected int forward = 1;

    /**
     * 分页页数
     */
    protected int pageNum = 1;

    /**
     * 一页多少数据
     */
    protected int pageSize = 400;

    public PageReadOnlyIterator() {
    }

    public PageReadOnlyIterator(int pageNum, int pageSize) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
    }

    public PageReadOnlyIterator(int forward, int pageNum, int pageSize) {
        this.forward = forward;
        this.pageNum = pageNum;
        this.pageSize = pageSize;
    }

    @Override
    public void forward() {
        this.pageNum = this.pageNum + forward;
    }


    public int getForward() {
        return forward;
    }

    public void setForward(int forward) {
        this.forward = forward;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
}
